Golang - 條件式與迴圈



if-else

if condition {
    ...
} else {
    ...
}

switch

switch condition {
case c1:
    ...
case c2:
    ...
default:
    ...
}

for

for i := 0; i < count; i++ {
    ...
}

while

for {
    ...
}
#golang #GO







你可能感興趣的文章

[PHP] 實建一個簡易MVC框架

[PHP] 實建一個簡易MVC框架

一起用 Google Calendar 與 D3.js 進行年終回顧吧!

一起用 Google Calendar 與 D3.js 進行年終回顧吧!

重新回歸學習程式 - part 1  20230308

重新回歸學習程式 - part 1 20230308






留言討論